031e885c20ac4326d7b76d030c305e0e1b1168c8,cdap-watchdog/src/main/java/co/cask/cdap/metrics/runtime/MetricsTwillRunnable.java,MetricsTwillRunnable,doInit,#TwillContext#,75
Before Change
// Set the hostname of the machine so that cConf can be used to start internal services
getCConfiguration().set(Constants.Metrics.ADDRESS, context.getHost().getCanonicalHostName());
Injector injector = createGuiceInjector(getCConfiguration(), getConfiguration());
injector.getInstance(LogAppenderInitializer.class).initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(),
Constants.Logging.COMPONENT_NAME,
Constants.Service.METRICS));
LOG.info("Initializing runnable {}", name);
LOG.info("{} Setting host name to {}", name, context.getHost().getCanonicalHostName());
zkClient = injector.getInstance(ZKClientService.class);
kafkaClient = injector.getInstance(KafkaClientService.class);
// Get the Metric Services
metricsQueryService = injector.getInstance(MetricsQueryService.class);
metricsCollectionService = injector.getInstance(MetricsCollectionService.class);
LOG.info("Runnable initialized {}", name);
} catch (Throwable t) {
After Change
// Set the hostname of the machine so that cConf can be used to start internal services
getCConfiguration().set(Constants.Metrics.ADDRESS, context.getHost().getCanonicalHostName());
injector = createGuiceInjector(getCConfiguration(), getConfiguration());
injector.getInstance(LogAppenderInitializer.class).initialize();
LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(),